package com.caocaog.market.controller;

import com.caocaog.market.entity.GoodsRelation;
import com.caocaog.market.service.IGoodsRelationService;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.common.system.base.controller.JeecgController;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

 /**
 * @Description: 商品关联信息表
 * @Author: guofeiyan
 * @Date:   2021-11-12
 * @Version: V1.0
 */
@Deprecated
@Api(tags="商品关联信息表")
@RestController
@RequestMapping("/goods/goodsRelation")
@Slf4j
public class GoodsRelationController extends JeecgController<GoodsRelation, IGoodsRelationService> {
	/*@Autowired
	private IGoodsRelationService goodsRelationService;*/

	/**
	 * 分页列表查询
	 *
	 * @param goodsRelation
	 * @param pageNo
	 * @param pageSize
	 * @param req
	 * @return
	 */
	/*@AutoLog(value = "商品关联信息表-分页列表查询")
	@ApiOperation(value="商品关联信息表-分页列表查询", notes="商品关联信息表-分页列表查询")
	@GetMapping(value = "/list")
	public Result<?> queryPageList(GoodsRelation goodsRelation,
								   @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
								   @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
								   HttpServletRequest req) {
		QueryWrapper<GoodsRelation> queryWrapper = QueryGenerator.initQueryWrapper(goodsRelation, req.getParameterMap());
		Page<GoodsRelation> page = new Page<GoodsRelation>(pageNo, pageSize);
		IPage<GoodsRelation> pageList = goodsRelationService.page(page, queryWrapper);
		return Result.OK(pageList);
	}*/

	/**
	 *   添加
	 *
	 * @param goodsRelation
	 * @return
	 */
	/*@AutoLog(value = "商品关联信息表-添加")
	@ApiOperation(value="商品关联信息表-添加", notes="商品关联信息表-添加")
	@PostMapping(value = "/add")
	public Result<?> add(@RequestBody GoodsRelation goodsRelation) {
		goodsRelationService.save(goodsRelation);
		return Result.OK("添加成功！",true);
	}*/

	/**
	 *  编辑
	 *
	 * @param goodsRelation
	 * @return
	 */
	/*@AutoLog(value = "商品关联信息表-编辑")
	@ApiOperation(value="商品关联信息表-编辑", notes="商品关联信息表-编辑")
	@PutMapping(value = "/edit")
	public Result<?> edit(@RequestBody GoodsRelation goodsRelation) {
		goodsRelationService.updateById(goodsRelation);
		return Result.OK("编辑成功!",true);
	}*/

	/**
	 *   通过id删除
	 *
	 * @param id
	 * @return
	 */
	/*@AutoLog(value = "商品关联信息表-通过id删除")
	@ApiOperation(value="商品关联信息表-通过id删除", notes="商品关联信息表-通过id删除")
	@DeleteMapping(value = "/delete")
	public Result<?> delete(@RequestParam(name="id",required=true) String id) {
		goodsRelationService.removeById(id);
		return Result.OK("删除成功!",true);
	}*/

	/**
	 *  批量删除
	 *
	 * @param ids
	 * @return
	 */
	/*@AutoLog(value = "商品关联信息表-批量删除")
	@ApiOperation(value="商品关联信息表-批量删除", notes="商品关联信息表-批量删除")
	@DeleteMapping(value = "/deleteBatch")
	public Result<?> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
		this.goodsRelationService.removeByIds(Arrays.asList(ids.split(",")));
		return Result.OK("批量删除成功!",true);
	}*/

	/**
	 * 通过id查询
	 *
	 * @param id
	 * @return
	 */
	/*@AutoLog(value = "商品关联信息表-通过id查询")
	@ApiOperation(value="商品关联信息表-通过id查询", notes="商品关联信息表-通过id查询")
	@GetMapping(value = "/queryById")
	public Result<?> queryById(@RequestParam(name="id",required=true) String id) {
		GoodsRelation goodsRelation = goodsRelationService.getById(id);
		if(goodsRelation==null) {
			return Result.error("未找到对应数据");
		}
		return Result.OK(goodsRelation);
	}*/

    /**
    * 导出excel
    *
    * @param request
    * @param goodsRelation
    */
    /*@RequestMapping(value = "/exportXls")
    public ModelAndView exportXls(HttpServletRequest request, GoodsRelation goodsRelation) {
        return super.exportXls(request, goodsRelation, GoodsRelation.class, "商品关联信息表");
    }*/

    /**
      * 通过excel导入数据
    *
    * @param request
    * @param response
    * @return
    */
    /*@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
    public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
        return super.importExcel(request, response, GoodsRelation.class);
    }*/

}
